<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>得到指定年份的复活节午夜时的Unix时间戳。</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.cal-to-jd.html">« cal_to_jd</a></li>
      <li style="float: right;"><a href="function.easter-days.html">easter_days »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.calendar.html">日历 函数</a></li>
    <li>得到指定年份的复活节午夜时的Unix时间戳。</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.easter-date" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">easter_date</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">easter_date</span> &mdash; <span class="dc-title">得到指定年份的复活节午夜时的Unix时间戳。</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.easter-date-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>easter_date</strong></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$year</code><span class="initializer"> = ?</span></span>): <span class="type">int</span></div>

  <p class="para rdfs-comment">
   返回指定年份的复活节午夜时的Unix时间戳。
  </p>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="para">
    如果给定的年份超出Unix时间戳的范围（比如1970年以前或2037年以后），该函数将返回一个警告。
   </p>
  </div>
  <p class="para">
   复活节的日期是由尼西亚议会在AD325年确定的为每年春分月圆后的第一个星期日。春分一般是在3月21日，这就简化为只要计算满月的日期和紧挨的星期日的日期。这里所用的算法是在532年由Dionysius Exiguus所介绍的，参考了Julian历法和Gregorian历法这两个历法来提高精确度。（在1753年以前用Julian历法计算，该历法是一个以19年为周期来确定月亮的相位的历法。在1753年以后用Gregorian历法计算，该历法由Clavius和Lilius发明，由Pope Gregory 8世在1582年推广）
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.easter-date-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">year</code></dt>

     <dd>

      <p class="para">
       1970年至2037年之间的数字形式的年份。
      </p>
     </dd>

      
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.easter-date-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   复活节日期的Unix时间戳。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.easter-date-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>Since 4.3.0</td>
       <td>
        <code class="parameter">year</code>参数可选，缺省的默认值是当年。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.easter-date-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1989">
    <p><strong>示例 #1 <span class="function"><strong>easter_date()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">"M-d-Y"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">easter_date</span><span style="color: #007700">(</span><span style="color: #0000BB">1999</span><span style="color: #007700">));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Apr-04-1999<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">"M-d-Y"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">easter_date</span><span style="color: #007700">(</span><span style="color: #0000BB">2000</span><span style="color: #007700">));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Apr-23-2000<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">"M-d-Y"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">easter_date</span><span style="color: #007700">(</span><span style="color: #0000BB">2001</span><span style="color: #007700">));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Apr-15-2001<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.easter-date-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member">
     <span class="function"><a href="function.easter-days.html" class="function" rel="rdfs-seeAlso">easter_days()</a> - 得到指定年份的3月21日到复活节之间的天数</span> for calculating Easter 
     before 1970 or after 2037
    </li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>